/**
 * 
 */
package web;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.IInvalidSong;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import dao.IInvalidSongDAO;

/**
 * @spring.bean name="invalidSongController"
 * @spring.property name="invalidSongService" ref="INVALID_SONG_SERIVCE"
 * @author ipeel
 *
 */
public class InvalidSongController implements Controller {
	private IInvalidSongDAO invalidSongService;

	/* (non-Javadoc)
	 * @see org.springframework.web.servlet.mvc.Controller#handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse resonse) throws Exception {
		List<IInvalidSong> invalidSongs = getInvalidSongService().getInvalidSongs();
		Map<String, Object> beans = new HashMap<String, Object>();
		beans.put("invalidSongs", invalidSongs);
		return new ModelAndView(IConstants.Views.INVALID_SONGS, beans);
	}

	public IInvalidSongDAO getInvalidSongService() {
		return invalidSongService;
	}

	public void setInvalidSongService(IInvalidSongDAO invalidSongService) {
		this.invalidSongService = invalidSongService;
	}

}
